package com.eeds.service.work.impl;

import com.eeds.common.table.WorkAttendanceEntity;
import com.eeds.dao.WorkAttendanceDao;
import com.eeds.model.work.req.ReqAddWorkAttendanceVO;
import com.eeds.model.work.req.ReqGetWorkAttendanceInfoVO;
import com.eeds.model.work.req.ReqUpdateWorkAttendanceVO;
import com.eeds.model.work.res.ResGetWorkAttendanceInfoVO;
import com.eeds.model.work.res.ResWorkAttendanceListVO;
import com.eeds.service.work.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkServiceImpl implements WorkService {


    @Autowired
    private WorkAttendanceDao workAttendanceDao;

    /**
     * 添加考勤记录
     *
     * @param reqAddWorkAttendanceVO
     * @return
     */
    @Override
    public Integer addWorkAttendance(ReqAddWorkAttendanceVO reqAddWorkAttendanceVO) {
        WorkAttendanceEntity workAttendanceEntity = new WorkAttendanceEntity();
        workAttendanceEntity.setIdUserBaseInfo(reqAddWorkAttendanceVO.getIdUserBaseInfo());
        workAttendanceEntity.setWorkAttendanceTime(reqAddWorkAttendanceVO.getWorkAttendanceTime());
        workAttendanceEntity.setSafeProductionState(reqAddWorkAttendanceVO.getSafeProductionState());
        workAttendanceEntity.setUpholdIntegrityState(reqAddWorkAttendanceVO.getUpholdIntegrityState());
        workAttendanceEntity.setTradeServiceState(reqAddWorkAttendanceVO.getTradeServiceState());
        workAttendanceEntity.setIdeologyState(reqAddWorkAttendanceVO.getIdeologyState());
        workAttendanceEntity.setExaminatioDataState(reqAddWorkAttendanceVO.getExaminatioDataState());
        workAttendanceEntity.setMaintainingStabilityState(reqAddWorkAttendanceVO.getMaintainingStabilityState());
        workAttendanceEntity.setDescendingOther(reqAddWorkAttendanceVO.getDescendingOther());
        workAttendanceEntity.setPersonalMinorInjuryIncidentInNonElectricPowerProduction(reqAddWorkAttendanceVO.getPersonalMinorInjuryIncidentInNonElectricPowerProduction());
        workAttendanceEntity.setScoringOfPowerGridEquipmentAndQualityEvents(reqAddWorkAttendanceVO.getScoringOfPowerGridEquipmentAndQualityEvents());
        workAttendanceEntity.setInformationSystemEventScore(reqAddWorkAttendanceVO.getInformationSystemEventScore());
        workAttendanceEntity.setTradeServiceState(reqAddWorkAttendanceVO.getTradeServiceState());
        workAttendanceEntity.setFireAndFireEventScore(reqAddWorkAttendanceVO.getFireAndFireEventScore());
        workAttendanceEntity.setOtherEventScore(reqAddWorkAttendanceVO.getOtherEventScore());
        workAttendanceEntity.setMarketingInAccordanceWithEwec(reqAddWorkAttendanceVO.getMarketingInAccordanceWithEwec());
        workAttendanceEntity.setTemporaryWorkOne(reqAddWorkAttendanceVO.getTemporaryWorkOne());
        workAttendanceEntity.setTemporaryWorkTwo(reqAddWorkAttendanceVO.getTemporaryWorkTwo());
        workAttendanceEntity.setTemporaryWorkThree(reqAddWorkAttendanceVO.getTemporaryWorkThree());
        workAttendanceEntity.setTemporaryWorkFour(reqAddWorkAttendanceVO.getTemporaryWorkFour());
        workAttendanceEntity.setCompetenceIndicators(reqAddWorkAttendanceVO.getCompetenceIndicators());
        workAttendanceEntity.setQualityOfWorkScore(reqAddWorkAttendanceVO.getQualityOfWorkScore());
        workAttendanceEntity.setWorkAttitudeScore(reqAddWorkAttendanceVO.getWorkAttitudeScore());
        workAttendanceEntity.setFullTimeScore(reqAddWorkAttendanceVO.getFullTimeScore());
        workAttendanceEntity.setWushuAndPukao(reqAddWorkAttendanceVO.getWushuAndPukao());
        workAttendanceEntity.setScoringInAllKindsOfCompetitions(reqAddWorkAttendanceVO.getScoringInAllKindsOfCompetitions());
        workAttendanceEntity.setScoresOfActivities(reqAddWorkAttendanceVO.getScoresOfActivities());
        workAttendanceEntity.setTeamPersonnelNotManagedAccordingTo6s(reqAddWorkAttendanceVO.getTeamPersonnelNotManagedAccordingTo6s());
        workAttendanceEntity.setTwoConsecutiveAbsencesFromVariousPartyActivities(reqAddWorkAttendanceVO.getTwoConsecutiveAbsencesFromVariousPartyActivities());
        workAttendanceEntity.setIncompleteNotesOfPartyMembers(reqAddWorkAttendanceVO.getIncompleteNotesOfPartyMembers());
        workAttendanceEntity.setNotLearningTheContentOfPowerfulCountries(reqAddWorkAttendanceVO.getNotLearningTheContentOfPowerfulCountries());
        workAttendanceEntity.setUnfinishedYouthUniversityStudy(reqAddWorkAttendanceVO.getUnfinishedYouthUniversityStudy());
        workAttendanceEntity.setPostCoefficient(reqAddWorkAttendanceVO.getPostCoefficient());
        workAttendanceEntity.setAbsenteeismDays(reqAddWorkAttendanceVO.getAbsenteeismDays());
        workAttendanceDao.insert(workAttendanceEntity);
        return 1;
    }

    /**
     * 修改考勤记录
     *
     * @param reqUpdateWorkAttendanceVO
     * @return
     */
    @Override
    public Integer updateWorkAttendance(ReqUpdateWorkAttendanceVO reqUpdateWorkAttendanceVO) {
        WorkAttendanceEntity workAttendanceEntity = new WorkAttendanceEntity();
        workAttendanceEntity.setIdUserBaseInfo(reqUpdateWorkAttendanceVO.getIdUserBaseInfo());
        workAttendanceEntity.setWorkAttendanceTime(reqUpdateWorkAttendanceVO.getWorkAttendanceTime());
        workAttendanceEntity.setSafeProductionState(reqUpdateWorkAttendanceVO.getSafeProductionState());
        workAttendanceEntity.setUpholdIntegrityState(reqUpdateWorkAttendanceVO.getUpholdIntegrityState());
        workAttendanceEntity.setTradeServiceState(reqUpdateWorkAttendanceVO.getTradeServiceState());
        workAttendanceEntity.setIdeologyState(reqUpdateWorkAttendanceVO.getIdeologyState());
        workAttendanceEntity.setExaminatioDataState(reqUpdateWorkAttendanceVO.getExaminatioDataState());
        workAttendanceEntity.setMaintainingStabilityState(reqUpdateWorkAttendanceVO.getMaintainingStabilityState());
        workAttendanceEntity.setDescendingOther(reqUpdateWorkAttendanceVO.getDescendingOther());
        workAttendanceEntity.setPersonalMinorInjuryIncidentInNonElectricPowerProduction(reqUpdateWorkAttendanceVO.getPersonalMinorInjuryIncidentInNonElectricPowerProduction());
        workAttendanceEntity.setScoringOfPowerGridEquipmentAndQualityEvents(reqUpdateWorkAttendanceVO.getScoringOfPowerGridEquipmentAndQualityEvents());
        workAttendanceEntity.setInformationSystemEventScore(reqUpdateWorkAttendanceVO.getInformationSystemEventScore());
        workAttendanceEntity.setTradeServiceState(reqUpdateWorkAttendanceVO.getTradeServiceState());
        workAttendanceEntity.setFireAndFireEventScore(reqUpdateWorkAttendanceVO.getFireAndFireEventScore());
        workAttendanceEntity.setOtherEventScore(reqUpdateWorkAttendanceVO.getOtherEventScore());
        workAttendanceEntity.setMarketingInAccordanceWithEwec(reqUpdateWorkAttendanceVO.getMarketingInAccordanceWithEwec());
        workAttendanceEntity.setTemporaryWorkOne(reqUpdateWorkAttendanceVO.getTemporaryWorkOne());
        workAttendanceEntity.setTemporaryWorkTwo(reqUpdateWorkAttendanceVO.getTemporaryWorkTwo());
        workAttendanceEntity.setTemporaryWorkThree(reqUpdateWorkAttendanceVO.getTemporaryWorkThree());
        workAttendanceEntity.setTemporaryWorkFour(reqUpdateWorkAttendanceVO.getTemporaryWorkFour());
        workAttendanceEntity.setCompetenceIndicators(reqUpdateWorkAttendanceVO.getCompetenceIndicators());
        workAttendanceEntity.setQualityOfWorkScore(reqUpdateWorkAttendanceVO.getQualityOfWorkScore());
        workAttendanceEntity.setWorkAttitudeScore(reqUpdateWorkAttendanceVO.getWorkAttitudeScore());
        workAttendanceEntity.setFullTimeScore(reqUpdateWorkAttendanceVO.getFullTimeScore());
        workAttendanceEntity.setWushuAndPukao(reqUpdateWorkAttendanceVO.getWushuAndPukao());
        workAttendanceEntity.setScoringInAllKindsOfCompetitions(reqUpdateWorkAttendanceVO.getScoringInAllKindsOfCompetitions());
        workAttendanceEntity.setScoresOfActivities(reqUpdateWorkAttendanceVO.getScoresOfActivities());
        workAttendanceEntity.setTeamPersonnelNotManagedAccordingTo6s(reqUpdateWorkAttendanceVO.getTeamPersonnelNotManagedAccordingTo6s());
        workAttendanceEntity.setTwoConsecutiveAbsencesFromVariousPartyActivities(reqUpdateWorkAttendanceVO.getTwoConsecutiveAbsencesFromVariousPartyActivities());
        workAttendanceEntity.setIncompleteNotesOfPartyMembers(reqUpdateWorkAttendanceVO.getIncompleteNotesOfPartyMembers());
        workAttendanceEntity.setNotLearningTheContentOfPowerfulCountries(reqUpdateWorkAttendanceVO.getNotLearningTheContentOfPowerfulCountries());
        workAttendanceEntity.setUnfinishedYouthUniversityStudy(reqUpdateWorkAttendanceVO.getUnfinishedYouthUniversityStudy());
        workAttendanceEntity.setPostCoefficient(reqUpdateWorkAttendanceVO.getPostCoefficient());
        workAttendanceEntity.setAbsenteeismDays(reqUpdateWorkAttendanceVO.getAbsenteeismDays());
        workAttendanceEntity.setIdWorkAttendance(reqUpdateWorkAttendanceVO.getIdWorkAttendance());
        workAttendanceDao.updateById(workAttendanceEntity);
        return 1;
    }

    /**
     * 获取考勤记录信息
     *
     * @param reqGetWorkAttendanceInfoVO
     * @return
     */
    @Override
    public ResGetWorkAttendanceInfoVO getWorkAttendanceInfo(ReqGetWorkAttendanceInfoVO reqGetWorkAttendanceInfoVO) {
        return workAttendanceDao.getWorkAttendanceInfo(reqGetWorkAttendanceInfoVO);
    }


    private void formula(ResWorkAttendanceListVO resWorkAttendanceListVO){

    }

}
